create
macOS factory for BackgroundTaskManager.
Hold the returned instance for the lifetime of the app — typically as a stored property on AppDelegate. The Swift call site reads:
let backgrounder = BackgroundTaskManager.companion.create()
backgrounder.register(taskId: SyncWorker.companion.ID) { /* SyncWorker(…) */}
backgrounder.start()Return
a constructed but not-yet-started BackgroundTaskManager. Call BackgroundTaskManager.register for every task id, then BackgroundTaskManager.start from applicationDidFinishLaunching.
Call BackgroundTaskManager.shutdown from applicationWillTerminate to cancel the scheduler's coroutine scope cleanly.
The pre-execution WorkConstraints.networkRequired gate reads from Reachability.shared (process-lifetime singleton). Tests install a FakeReachability via the :reachable-testing artifact's withFakeReachability { … } helper.
@OptIn(ExperimentalObjCName::class): required by SKIE for the Swift-rename annotation. Stable in practice.
Parameters
observability hook for onScheduled, onStarted, onCompleted, onCancelled. Defaults to BackgrounderEventListener.Noop.